package com.example.nfcaccesssystem;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

@SuppressWarnings("deprecation")
public class MainActivity extends TabActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		
		setContentView(R.layout.activity_main);
		
		TabHost tabHost = getTabHost();
		 
        // Tab for Users
        TabSpec userspec = tabHost.newTabSpec("Users");
        userspec.setIndicator("Users");
        // setting Title and Icon for the Tab
        //photospec.setIndicator("Photos", getResources().getDrawable(R.drawable.icon_photos_tab));
        Intent usersIntent = new Intent(this, UserActivity.class);
        userspec.setContent(usersIntent);
 
        // Tab for Doors
        TabSpec doorspec = tabHost.newTabSpec("Doors");
        doorspec.setIndicator("Doors");
        //doorspec.setIndicator("Songs", getResources().getDrawable(R.drawable.icon_songs_tab));
        Intent doorsIntent = new Intent(this, DoorActivity.class);
        doorspec.setContent(doorsIntent);
 
 
        // Adding all TabSpec to TabHost
        tabHost.addTab(userspec); // Adding photos tab
        tabHost.addTab(doorspec); // Adding songs tab
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

}
